//package com.baocai.tools.aop;
//
//import com.dingyong.data.application.common.annotation.HideWrape;
//import com.dingyong.data.application.common.model.result.Result;
//import com.dingyong.data.application.dao.dto.StudentExamResultDto;
//import com.dingyong.data.application.dao.dto.StudentExaminationResultDto;
//import com.dingyong.data.application.service.HideWrapeService;
//import org.aspectj.lang.JoinPoint;
//import org.aspectj.lang.annotation.*;
//import org.aspectj.lang.reflect.MethodSignature;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Component;
//
//import java.lang.reflect.Method;
//
///**
// * @author ：minyang
// * @date ：Created in 2020/3/6 10:59
// */
//@Aspect
//@Component
//public class hideWrapeAop {
//
//    @Autowired
//    HideWrapeService hideWrapeService;
//
//    @Pointcut("execution( * com.dingyong.data.application.client.controller.*.*(..))")
//    public void daoAspect() {
//    }
//
//    @Before("daoAspect()")
//    public void beforeAop(JoinPoint point) {
//
//    }
//
//    //@After("daoAspect()")
//    @AfterReturning(value = "daoAspect()", returning = "returnResult")
//    public void convertHide(JoinPoint point,Object returnResult) {
//        try {
//            Class clazz = point.getTarget().getClass();
//            String targetName = clazz.getSimpleName();
//            String methodName = point.getSignature().getName();
//            Class[] parameterTypes = ((MethodSignature)point.getSignature()).getMethod().getParameterTypes();
//            Method methdo = clazz.getMethod(methodName,parameterTypes);
//
//            if (methdo.isAnnotationPresent(HideWrape.class)) {
//                HideWrape hideWrape = methdo.getAnnotation(HideWrape.class);
//                String describe = hideWrape.describe();
//                if(describe.equals("ExamResult"))
//                {
//                    Result resultVO = (Result) returnResult;
//                    StudentExamResultDto dto = (StudentExamResultDto)resultVO.getData();
//                    StudentExamResultDto newdto =hideWrapeService.hidegetStudentExamResultWrap(dto);
//                    resultVO.setData(newdto);
//                }
//                if(describe.equals("SubjectResult"))
//                {
//                    Result resultVO = (Result) returnResult;
//                    StudentExaminationResultDto dto = (StudentExaminationResultDto)resultVO.getData();
//                    StudentExaminationResultDto newdto =hideWrapeService.hidegetStudentSubjectResultWrap(dto);
//                    resultVO.setData(newdto);
//                }
//            }
//
//
//
//        }catch (Exception e)
//        {
//
//        }
//
//    }
//}
